import React from "react";
import { Modal, Form, Radio } from "antd";
import { modalPropsType } from "@/constants/types";
import { useModel } from "@umijs/max";


const CluRemark = ({visible, title, onCancel, onSubmit, currentRow}: modalPropsType) => {
  const [form] = Form.useForm();
  const {getDict} = useModel('dictModel');
  const clueInvalidRemark = getDict('clueInvalidRemark');
  
  const handleSubmit = async () => {
    const res = await form.validateFields();
    onSubmit({
      ...res,
      cluesId: currentRow?.id
    });
  }

  return (
    <Modal
      open={visible}
      title={title}
      onCancel={onCancel}
      onOk={handleSubmit}
      maskClosable={false}
    >
      <Form form={form} className="modal-form-padding">
        <Form.Item label="备注" name="tag">
          <Radio.Group options={clueInvalidRemark} />
        </Form.Item>
      </Form>
    </Modal>
  );
}
export default CluRemark;